﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Media;
using CoiffeurProject.Utils;
using System.Windows.Input;

namespace CoiffeurProject.UserControls
{
    #region Customer Dash Arrow

    internal class DashArrow
    {
        Button button;
        Image pressed;
        Image not_pressed;

        internal DashArrow(DashArrowVerse verse, Thickness margin, int row, int column, Action<object, RoutedEventArgs> click_event_handler)
        {
            not_pressed = new Image()
            {
                Source = new BitmapImage(new Uri(verse == DashArrowVerse.Left ? ImagesPath.CusDashArrowLeft : ImagesPath.CusDashArrowRight)),
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Stretch = Stretch.Fill
            };

            pressed = new Image()
            {
                Source = new BitmapImage(new Uri(verse == DashArrowVerse.Left ? ImagesPath.CusDashArrowLeftPress : ImagesPath.CusDashArrowRightPress)),
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Stretch = Stretch.Fill
            };

            button = new Button()
            {
                Content = not_pressed,
                Width = 51,
                Height = 50,
                Margin = margin,
                VerticalAlignment = VerticalAlignment.Top,
                HorizontalAlignment = HorizontalAlignment.Left
            };

            button.Click += new RoutedEventHandler(click_event_handler);
            button.MouseEnter += new MouseEventHandler(button_MouseEnter);
            button.MouseLeave += new MouseEventHandler(button_MouseLeave);
            button.SetResourceReference(Button.StyleProperty, "NoChromeButton");

            Grid.SetColumn(button, column);
            Grid.SetRow(button, row);
        }

        void button_MouseLeave(object sender, MouseEventArgs e)
        {
            button.Content = not_pressed;
        }

        void button_MouseEnter(object sender, MouseEventArgs e)
        {
            button.Content = pressed;
        }

        internal Button MainContainer
        {
            get { return button; }
        }
    }

    internal enum DashArrowVerse
    {
        Left,
        Right
    }

    #endregion
}
